package com.hz.pro.kitchen.controller;

import com.hz.pro.kitchen.annotation.HttpLog;
import com.hz.pro.kitchen.dal.entity.UserEntity;
import com.hz.pro.kitchen.manager.UserManager;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 */
@RestController
@Slf4j
@RequestMapping("test")
@HttpLog
public class TestController {

    @Resource
    private UserManager userManager;

    @GetMapping(value = "/test")
    public String test(){
        UserEntity entity = new UserEntity();
        entity.setUserid(UUID.randomUUID().toString().replace("-", ""));
        entity.setUsername("gxx");
        entity.setEmail("17682323793@163.com");
        entity.setMobile("17682323793");
        entity.setName("gg");
        entity.setOrganizationid(123321L);
        entity.setRole(1);
        entity.setSiteid(1L);
        entity.setSex(0);
        userManager.insertUser(entity);
        return "ok";
    }
}
